#include <iostream>
#include <memory>
#include "tcpClient.hpp"
#include "log.hpp"

using namespace yzc_client;
void Usage(const std::string &proc)
{
    std::cout << "\nUsage:\n\t" << proc << " serverip" << " serverport\n\n";
}

// ./tcpClient serverip serverport
int main(int argc, char *argv[])
{
    if (argc != 3)
    {
        Usage(argv[0]);
        exit(USAGE_ERR);
    }

    std::string serverip = argv[1];
    uint16_t serverport = atoi(argv[2]);

    std::unique_ptr<TcpClient> tcli(new TcpClient(serverip, serverport));
    tcli->InitClient();
    tcli->start();
    return 0;
}